package com.jm.web.tags;

import com.jm.web.BasePage;
import com.jm.web.builder.FormPageBuilder;
import com.jm.web.builder.GridPageBuilder;
import com.jm.web.builder.PageBuilder;
import com.jm.web.tags.support.BaseTag;


/**
 * @author yanjie
 *
 * 2011/9/19 上午11:28:56
 * 页面tag
 */
public class PageTag extends BaseTag{
	private static final long serialVersionUID = -4808761763548058981L;

	public void setAction(String strAction) {
		SetExtValue(BasePage.TAG_ACTION,strAction);
	}
	
	public void setActionType(String strActionType) {
		SetExtValue(BasePage.TAG_ACTION_TYPE,strActionType);
	}
	
	public void setActionValue(String strActionValue) {
		SetExtValue(BasePage.TAG_ACTION_VALUE,strActionValue);
	}
	
	@Override
	public String getBuilderName() {
		if("grid".equalsIgnoreCase(this.GetExtValue(BasePage.TAG_ACTION,"page")))
			return GridPageBuilder.class.getName();
		
		if("form".equalsIgnoreCase(this.GetExtValue(BasePage.TAG_ACTION,"page")))
			return FormPageBuilder.class.getName();
		
		if("page".equalsIgnoreCase(this.GetExtValue(BasePage.TAG_ACTION,"page")))
			return PageBuilder.class.getName();
		
		return PageBuilder.class.getName();
	}
}
